import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.Before;


public class CalLogicTest {
	
	CalLogic cal;

	@Before
	public void setUp() {
		cal = new CalLogic();
	}

	@Test
	public void testValidDate() {
		assertTrue(cal.validDate("07/31/2014"));
	}
	
	@Test
	public void testInValidDate() {
		assertFalse(cal.validDate("02-31-2014"));
	}
	
	@Test
	public void testInValidDateFormat() {
		assertFalse(cal.validDate("07-31-2014"));
	}

	@Test
	public void testValidTime() {
		assertTrue(cal.validTime("12:00 am"));
	}
	
	@Test
	public void testInValidTime() {
		assertFalse(cal.validTime("13:00 pm"));
	}
	
	@Test
	public void testInValidTimeFormat() {
		assertFalse(cal.validTime("99:99:99"));
	}
	
	@Test
	public void testAMPMtoMil() throws Exception {
		assertEquals(cal.AMPMtoMil("01:00 pm"), "1300");
	}

}
